<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="description" content="Text2Tex: Text-driven Texture Synthesis via Diffusion Models">
    <meta name="keywords" content="Text2Tex, diffusion, 3D textures, 3D contents, generation">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>SceneTex: High-Quality Texture Synthesis for Indoor Scenes via Diffusion Priors</title>

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <link href="https://fonts.googleapis.com/css?family=Google+Sans|Noto+Sans|Castoro" rel="stylesheet">

    <link rel="stylesheet" href="./static/css/bulma.min.css">
    <link rel="stylesheet" href="./static/css/bulma-carousel.min.css">
    <link rel="stylesheet" href="./static/css/bulma-slider.min.css">
    <link rel="stylesheet" href="./static/css/fontawesome.all.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
    <link rel="stylesheet" href="./static/css/index.css">

    <style>
		.render_wrapper {
			position: relative;
            height: 300px;
         }
        .render_wrapper_small {
			position: relative;
            height: 200px;
         }
		.render_div {
			position: absolute;
			top: 0;
			left: 0;
		}

        #interpolation-image-wrapper-car{
            text-align: center;
        }
        #interpolation-image-wrapper-chair{
            text-align: center;
        }
        .nested-columns {
            margin-bottom: 0 !important;
        }
    </style>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script defer src="./static/js/fontawesome.all.min.js"></script>
    <script src="./static/js/bulma-carousel.min.js"></script>
    <script src="./static/js/bulma-slider.min.js"></script>
    <script src="./static/js/index.js"></script>
</head>

<body>

    <section class="hero">
        <div class="hero-body">
            <div class="container is-max-desktop">
                <div class="columns is-centered">
                    <div class="column has-text-centered">
                        <h1 class="title is-1 publication-title">SceneTex: High-Quality Texture Synthesis for Indoor Scenes via Diffusion Priors
                        </h1>
                        <div class="is-size-5 publication-authors">
                            <span class="author-block">
                                <a href="https://niessnerlab.org/members/zhenyu_chen/profile.html">Dave Zhenyu Chen</a><sup>1</sup>,</span>
                            <span class="author-block">
                                <a href="">Haoxuan Li</a><sup>1</sup>,</span>
                            <span class="author-block">
                                <a href="https://research.snap.com/team/team-member.html#hsin-ying-lee">Hsin-Ying Lee</a><sup>2</sup>,</span>
                            <span class="author-block">
                                <a href="https://research.snap.com/team/team-member.html#sergey-tulyakov">Sergey Tulyakov</a><sup>2</sup>,
                            </span>
                            <span class="author-block">
                                <a href="https://niessnerlab.org/members/matthias_niessner/profile.html">Matthias Nießner</a><sup>1</sup>,
                            </span>
                        </div>

                        <div class="is-size-5 publication-authors">
                            <span class="author-block"><sup>1</sup>Technical University of Munich,</span>
                            <span class="author-block"><sup>2</sup>Snap Research</span>
                        </div>

                        <div class="column has-text-centered">
                            <div class="publication-links">
                                <!-- PDF Link. -->
                                <span class="link-block">
                                    <a href="static/SceneTex.pdf"
                                        class="external-link button is-normal is-rounded is-dark">
                                        <span class="icon">
                                            <i class="fas fa-file-pdf"></i>
                                        </span>
                                        <span>Paper</span>
                                    </a>
                                </span>
                                <span class="link-block">
                                    <a class="external-link button is-normal is-rounded is-dark" href="https://arxiv.org/abs/2311.17261">
                                        <span class="icon">
                                            <i class="ai ai-arxiv"></i>
                                        </span>
                                        <span>arXiv</span>
                                    </a>
                                </span>
                                <!-- Video Link. -->
                                <span class="link-block">
                                    <a href="https://youtu.be/-x8oMeLovDU?si=s4D9e9m-mDVbE6MY"
                                        class="external-link button is-normal is-rounded is-dark">
                                        <span class="icon">
                                            <svg class="svg-inline--fa fa-youtube fa-w-18" aria-hidden="true"
                                                focusable="false" data-prefix="fab" data-icon="youtube" role="img"
                                                xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"
                                                data-fa-i2svg="">
                                                <path fill="currentColor"
                                                    d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z">
                                                </path>
                                            </svg><!-- <i class="fab fa-youtube"></i> Font Awesome fontawesome.com -->
                                        </span>
                                        <span>Video</span>
                                    </a>
                                </span>


                                <!-- Github Link. -->
                                <span class="link-block">
                                    <a href="https://github.com/daveredrum/SceneTex" class="external-link button is-normal is-rounded is-dark">
                                        <span class="icon">
                                            <i class="fab fa-github"></i>
                                        </span>
                                        <span>Code</span>
                                    </a>
                                </span>
                                <!-- Dataset Link. -->
                                <span class="link-block"></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section class="hero teaser">
        <div class="container is-max-desktop">
            <div class="hero-body">
                <img src="./static/teaser/teaser.jpg" width="200%" />
                <h2 class=" subtitle has-text-centered" style="padding-top: 10px">
                    <span class="dnerf">SceneTex</span> generates high-quality textures for 3D indoor scenes from the given text prompts. 
                    At its core, SceneTex proposes a multiresolution texture field to implicitly encode the mesh appearance. 
                    We optimize the target texture via a score-distillation-based objective function in respective RGB renderings. 
                    To further secure the style consistency across views, we introduce a cross-attention decoder to predict the RGB values by cross-attending to the pre-sampled reference locations in each instance.
                    Our method enables various and accurate texture synthesis for 3D-FRONT scenes, demonstrating significant improvements in visual quality and prompt fidelity over the prior texture generation methods.
                </h2>
            </div>
        </div>
    </section>


    <section class="section">
        <div class="container is-max-desktop">
            <!-- Abstract. -->
            <!-- 
            <div class="columns is-centered has-text-centered">
                <div class="column is-four-fifths">
                    <h2 class="title is-3">Abstract</h2>
                    <div class="content has-text-justified">
                        <p>
                            We present Text2Tex, a novel method for generating high-quality textures for 3D meshes from the given text prompts.
                            Our method incorporates inpainting into a pre-trained depth-aware image diffusion model to progressively synthesize high resolution partial textures from multiple viewpoints. 
                        </p>

                        <p>
                            To avoid accumulating inconsistent and stretched artifacts across views, we dynamically segment the rendered view into a generation mask, which represents the generation status of each visible texel. 
                            This partitioned view representation guides the depth-aware inpainting model to generate and update partial textures for the corresponding regions. 
                        </p>
                        
                        <p>
                            Furthermore, we propose an automatic view sequence generation scheme to determine the next best view for updating the partial texture.
                        </p>
                        
                        <p>
                            Extensive experiments demonstrate that our method significantly outperforms the existing text-driven approaches and GAN-based methods.
                        </p>
                    </div>
                </div>
            </div>
             -->
            <!-- Paper video. -->
            <div class="columns is-centered has-text-centered">
                <div class="column is-four-fifths">
                    <h2 class="title is-3">Video</h2>
                    <div class="publication-video">
                        <iframe width="560" height="315" src="https://www.youtube.com/embed/-x8oMeLovDU?si=s4D9e9m-mDVbE6MY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
                    </div>
                </div>
            </div>
            <!--/ Paper video. -->
        </div>
    </section>

    <section class="hero is-light is-small">
        <div class="hero-body">
            <div class="container">
                <h2 class="title is-3">Comparison with baselines</h2>
                
                <div id="results-carousel" class="carousel results-carousel">
                    <div>
			            <div style="text-align: center; font-size: large;">Latent-Paint </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">MVDiffusion </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">Text2Tex </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">Ours </div>
                    </div>
                </div>
                <div id="results-carousel" class="carousel results-carousel">
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_scandinavian_style_living_room/latent.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_scandinavian_style_living_room/mvdiffusion.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_scandinavian_style_living_room/text2tex.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_scandinavian_style_living_room/ours.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>

                <div style="text-align: center; font-size: large; height: 50px;">"a Scandinavian style living room" </div>

                <div id="results-carousel" class="carousel results-carousel">
                    <div>
			            <div style="text-align: center; font-size: large;">Latent-Paint </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">MVDiffusion </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">Text2Tex </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">Ours </div>
                    </div>
                </div>
                <div id="results-carousel" class="carousel results-carousel">
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_japanese_style_bedroom/latent.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_japanese_style_bedroom/mvdiffusion.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_japanese_style_bedroom/text2tex.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_japanese_style_bedroom/ours.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>

                <div style="text-align: center; font-size: large; height: 50px;">"a Japanese style bedroom" </div>
                
                
                
            </div>
        </div>

        <div class="hero-body">
            <div class="container">
                <h2 class="title is-3">Stylization for 3D-FRONT Scenes</h2>
                
                <div id="results-carousel" class="carousel results-carousel">
                    <div>
			            <div style="text-align: center; font-size: large;">"... Bohemian ..." </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">"... Baroque ..." </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">"... French country ..." </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">"... Japanese ..." </div>
                    </div>
                </div>
                <div id="results-carousel" class="carousel results-carousel">
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/living_room/bohemian.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/living_room/baroque.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/living_room/french.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/living_room/japanese.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>
                
                <div style="text-align: center; font-size: large; height: 50px;">"a ... style living room" </div>
                
                <div id="results-carousel" class="carousel results-carousel">
                    <div>
			            <div style="text-align: center; font-size: large;">"... Bohemian ..." </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">"... Baroque ..." </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">"... French country ..." </div>
                    </div>
                    <div>
			            <div style="text-align: center; font-size: large;">"... Japanese ..." </div>
                    </div>
                </div>
                <div id="results-carousel" class="carousel results-carousel">
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/bedroom/bohemian.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/bedroom/baroque.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/stylization/bedroom/french.mp4" type="video/mp4">
                        </video>
                    </div>
                    <div class="item item-steve">
			            <video poster="" autoplay="" muted loop="" style="pointer-events: none;">
                            <source src="./static/video/a_japanese_style_bedroom/ours.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>
                
                <div style="text-align: center; font-size: large; height: 50px;">"a ... style bedroom" </div>

            </div>
        </div>
    </section>

    <section class="section">
        <div class="container is-max-desktop">

            <!-- Overview. -->
            <div class="columns is-centered" style="margin-top: 15px">
                <div class="column is-full-width">
                    <h2 class="title is-4">Method Overview</h2>
                    <img src="./static/teaser/architecture.jpg"/>
                    <div class="content has-text-justified" style="padding-top: 15px">
                        <p>
                            In <span class="dnerf">SceneTex</span>, the target mesh is first projected to a given viewpoint via a rasterizer.
                            Then, we render an RGB image with the proposed multiresolution texture field module.
                            Specifically, each rasterized UV coordinate is taken as input to sample the UV embeddings from a multiresoultion texture.
                            Afterward, the UV embeddings are mapped to an RGB image of shape 768 x 768 x 3 via a cross-attention texture decoder.
                            We use a pre-trained VAE encoder to compress the input RGB image to a 96 x 96 x 4 latent feature.
                            Finally, the Variational Score Distillation loss is computed from the latent feature to update the texture field.
                        </p>
                    </div>

                </div>
            </div>

            <!-- CA. -->
            <div class="columns is-centered" style="margin-top: 15px">
                <div class="column is-full-width">
                    <h2 class="title is-4">Cross-Attention Texture Decoder</h2>
                    <center><img src="./static/teaser/cross_attention.jpg" width="60%"/></center>
                    <div class="content has-text-justified" style="padding-top: 15px">
                        <p>
                            To secure the style-consistency, <span class="dnerf">SceneTex</span> incorporates a <b>Cross-attention Texture Decoder</b>.
                            For each rasterized UV coordinate, we apply a UV instance mask to mask out the corresponding instance texture features.
                            Then, we obtain the rendering UV embeddings for the rasterized locations in the view. 
                            At the same time, we extract the texture features for the pre-sampled UVs scattered across this instance as the reference UV embeddings. 
                            We deploy a multi-head cross-attention module to produce the instance-aware UV embeddings. 
                            Here, we treat the rendering UV embeddings as the Query, and the reference UV embeddings as the Key and Value. 
                            Finally, a shared MLP maps the instance-aware UV embeddings to RGB values in the rendered view.
                        </p>
                    </div>

                </div>
            </div>

        </div>
    </section>

    <section class="section" id="BibTeX">
        <div class="container is-max-desktop content">
            <h2 class="title">BibTeX</h2>
            <pre>
<code>
@misc{chen2023scenetex,
    title={SceneTex: High-Quality Texture Synthesis for Indoor Scenes via Diffusion Priors}, 
    author={Dave Zhenyu Chen and Haoxuan Li and Hsin-Ying Lee and Sergey Tulyakov and Matthias Nießner},
    year={2023},
    eprint={2311.17261},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}
</code></pre>
        </div>
    </section>


    <footer class="footer">
        <div class="container">
            <div class="content has-text-centered">
                <a class="icon-link" href="static/SceneTex.pdf">
                    <i class="fas fa-file-pdf"></i>
                </a>
                <a class="icon-link" href="https://github.com/daveredrum" class="external-link" disabled>
                    <i class="fab fa-github"></i>
                </a>
            </div>
            <div class="columns is-centered">
                <div class="column is-8">
                    <div class="content">
                        <p style="text-align:center">
                            Source code mainly borrowed from <a href="https://niessnerlab.org/members/yawar_siddiqui/profile.html">Yawar Siddiqui</a>'s <a
                                href="https://nihalsid.github.io/texturify/">Texturify website</a>.
                        </p>
                        <p style="text-align:center">
                            Please contact <a href="https://niessnerlab.org/members/zhenyu_chen/profile.html">Dave Zhenyu Chen</a> for feedback and questions.
                        </p>

                    </div>
                </div>
            </div>
        </div>
    </footer>

    <!-- Import maps polyfill -->
    <!-- Remove this when import maps will be widely supported -->
    <script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>

    <script type="importmap">
        {
            "imports": {
                "three": "./js/three.module.js"
            }
        }
    </script>

    <script type="module">

        import * as THREE from 'three';

        import { PLYLoader } from './js/PLYLoader.js';
        import { OBJLoader } from './js/OBJLoader.js';
        import { MTLLoader } from './js/MTLLoader.js';
        import { OrbitControls } from './js/OrbitControls.js'
        let div_to_scene = {
            "compass": {},
            "ambulance": {},
            "backpack": {},
            "dumpster": {},
            "baroque": {}, 
            "wooden": {}, 
            "cyberpunk": {}, 
            "lego": {},
            "airplane": {}, 
            "crocodile": {}, 
            "hippo": {}, 
            "sheep": {}
        };
        let div_camera = {
            "compass": null,
            "ambulance": null,
            "backpack": null,
            "dumpster": null,
            "baroque": null,
            "wooden": null,
            "cyberpunk": null,
            "lego": null,
            "airplane": null,
            "crocodile": null,
            "hippo": null,
            "sheep": null,
        };
        
        let mouse_button_down = false;
        let list_of_orbit_controls = []
        let style_camera = null;
        let render_colors = true;
        let style_id = "0"

        function setup_camera(div_name){
            let container = document.getElementById(div_name);
            let width = container.parentElement.clientWidth;
            let height = container.parentElement.clientHeight;
            console.log(width, height)
            let camera = new THREE.PerspectiveCamera( 35, width / height, 0.1, 50 );
            let camera_init_position = new THREE.Vector3( -1, 0.5, 1 );
            if (div_name.includes("compass")){
                camera_init_position = new THREE.Vector3( 1, 1.5, 1 );
            }
            else if (div_name.includes("ambulance")) {
                camera_init_position = new THREE.Vector3( -1.1, 0.5, 1.1 );
            }
            // else if (div_name.includes("backpack")) {
            //     camera_init_position = new THREE.Vector3( -1.5, 0.5, 1.5 );
            // }
            camera.position.set(camera_init_position.x, camera_init_position.y, camera_init_position.z);
            return camera;
        }

        function setup_render_divs(div_name, obj_name, obj_path, mtl_path, texture_path){
            if (div_camera[obj_name] == null) {
                div_camera[obj_name] = setup_camera(div_name)
            }
            
            let orbit_control = create_render_div(div_camera[obj_name], div_name, obj_name, obj_path, mtl_path, texture_path)
            list_of_orbit_controls.push(orbit_control)
        }

        function create_render_div(camera, div_id, obj_name, obj_path, mtl_path, texture_path) {
            let container;
            let renderer, controls;

            init();
            animate();

            function init() {

                container = document.getElementById(div_id);
                let width = container.parentElement.clientWidth;
                let height = container.parentElement.clientHeight;


                div_to_scene[obj_name][div_id] = new THREE.Scene();
                div_to_scene[obj_name][div_id].background = new THREE.Color( 0xffffff );

                // ObJ file

                const objLoader  = new OBJLoader();
                const textureLoader = new THREE.TextureLoader();
                const mtlLoader = new MTLLoader();

                mtlLoader.load(mtl_path, function ( materials ) {
                    materials.preload();
                    objLoader
                        .setMaterials( materials )
                        .load( obj_path, function ( object ) {
                            textureLoader
                                .load( texture_path, function ( texture ) {
                                    object.traverse (function ( child ) {
                                        if ( child instanceof THREE.Mesh ) {
                                            child.material.map = texture;
                                        }
                                    });

                                    div_to_scene[obj_name][div_id].add( object );
                                });
                        });
                });

                div_to_scene[obj_name][div_id].add( new THREE.HemisphereLight( 0x333333, 0x222222 ) );
                addShadowedLight(div_to_scene[obj_name][div_id], 1, 1, 1, 0xffffff, 1 );
                addShadowedLight(div_to_scene[obj_name][div_id],  -1, -1, - 1, 0xffffff, 0.5 );

                // renderer

                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.setPixelRatio( window.devicePixelRatio );
                renderer.setSize( width, height);
                renderer.outputEncoding = THREE.sRGBEncoding;

                renderer.shadowMap.enabled = true;

                container.appendChild( renderer.domElement );

                controls = new OrbitControls(camera, renderer.domElement)
                controls.enableDamping = false

                // resize

                window.addEventListener( 'resize', onWindowResize );

        }
            function onWindowResize() {
                let width = container.clientWidth;
                let height = container.clientHeight;
                camera.aspect = width / height;
                camera.updateProjectionMatrix();
                renderer.setSize( width, height );
            }
            function animate() {
                requestAnimationFrame( animate );
                render();
            }

            function render() {
                renderer.render( div_to_scene[obj_name][div_id], camera );
                controls.update();
            }

            return controls;
        }

        function addShadowedLight(scene, x, y, z, color, intensity ) {

            const directionalLight = new THREE.DirectionalLight( color, intensity );
            directionalLight.position.set( x, y, z );
            scene.add( directionalLight );

            directionalLight.castShadow = true;

            const d = 1;
            directionalLight.shadow.camera.left = - d;
            directionalLight.shadow.camera.right = d;
            directionalLight.shadow.camera.top = d;
            directionalLight.shadow.camera.bottom = - d;

            directionalLight.shadow.camera.near = 1;
            directionalLight.shadow.camera.far = 4;

            directionalLight.shadow.mapSize.width = 1024;
            directionalLight.shadow.mapSize.height = 1024;

            directionalLight.shadow.bias = - 0.001;

        }

        document.addEventListener('keydown', logKey);

        function logKey(evt) {
            if (evt.keyCode === 82 && !mouse_button_down) {
                reset_orbit_controls()
            }
        }

        function reset_orbit_controls() {
            list_of_orbit_controls.forEach(oc => {
                oc.reset()
            })
        }

        document.body.onmousedown = function(evt) {
            if (evt.button === 0)
                mouse_button_down = true
        }
        document.body.onmouseup = function(evt) {
            if (evt.button === 0)
                mouse_button_down = false
        }

        window.onload = function() {
            let slider = document.getElementsByClassName("slider")[0]
            slider.removeAttribute("tabIndex")
            // slider.addEventListener("mouseout", reset_orbit_controls);

            // const qualitative = ["compass", "ambulance", "backpack", "dumpster"];
            const qualitative = ["compass", "ambulance"];

            qualitative.forEach(element => {
                setup_render_divs(element+"_geo", element,
                './samples/qualitative/'+element+'/geo/mesh_normalized.obj', 
                './samples/qualitative/'+element+'/geo/mesh_normalized.mtl', 
                './samples/qualitative/'+element+'/geo/mesh_normalized.png'
                );
                setup_render_divs(element+"_clipmesh", element,
                    './samples/qualitative/'+element+'/clipmesh/mesh_normalized.obj', 
                    './samples/qualitative/'+element+'/clipmesh/mesh_normalized.mtl', 
                    './samples/qualitative/'+element+'/clipmesh/mesh_normalized.png'
                );
                setup_render_divs(element+"_latentpaint", element,
                    './samples/qualitative/'+element+'/latentpaint/mesh_normalized.obj', 
                    './samples/qualitative/'+element+'/latentpaint/mesh_normalized.mtl', 
                    './samples/qualitative/'+element+'/latentpaint/mesh_normalized.png'
                );
                setup_render_divs(element+"_ours", element,
                    './samples/qualitative/'+element+'/ours/mesh_normalized.obj', 
                    './samples/qualitative/'+element+'/ours/mesh_normalized.mtl', 
                    './samples/qualitative/'+element+'/ours/mesh_normalized.png'
                );
            });


            const styles = ["baroque", "wooden", "cyberpunk", "lego"];
            styles.forEach(element => {
                setup_render_divs(element+"_porsche", element,
                './samples/different_style/'+element+'_porsche/mesh_normalized.obj', 
                './samples/different_style/'+element+'_porsche/mesh_normalized.mtl', 
                './samples/different_style/'+element+'_porsche/mesh_normalized.png'
                );
            });

            const others = ["airplane", "crocodile", "hippo", "sheep"];
            others.forEach(element => {
                setup_render_divs(element+"_porsche", element,
                './samples/wrong_prompt/'+element+'/mesh_normalized.obj', 
                './samples/wrong_prompt/'+element+'/mesh_normalized.mtl', 
                './samples/wrong_prompt/'+element+'/mesh_normalized.png'
                );
            });
            
        };

    </script>
</body>

</html>
